package com.rie06.openvoip;


import com.rie06.openvoip.server.ServerTCPThread;
import com.rie06.openvoip.server.ServerUDP;
import java.net.InetAddress;
import java.util.UUID;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;

/**
 *
 * @author clement
 */
public class User {
    private UUID id;
    private String userName;
    //TCP
    private ServerTCPThread serverTCPThread;
    //UDP
    private ServerUDP serverUDPThread;
    //IP
    private InetAddress ipAddress;
    
    private Integer port;
    
    private static final Logger logger = Logger.getLogger(User.class);
    
    public User(UUID id, String userName){
        this.id = id;
        this.userName = userName;
        
        logger.log(Level.INFO, "New User Added: "+id.toString()+" - "+userName);
    }

    public UUID getId() {
        return id;
    }

    public ServerTCPThread getServerTCPThread() {
        return serverTCPThread;
    }

    public void setServerTCPThread(ServerTCPThread serverTCPThread) {
        this.serverTCPThread = serverTCPThread;
    }

    public ServerUDP getServerUDPThread() {
        return serverUDPThread;
    }

    public void setServerUDPThread(ServerUDP serverUDPThread) {
        this.serverUDPThread = serverUDPThread;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public InetAddress getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(InetAddress ipAddress) {
        this.ipAddress = ipAddress;
    }

    public Integer getPort() {
        return this.serverTCPThread.getSocket().getPort();
    }

    
}
